package com.eascs.workflow.sys.user;

import org.springframework.stereotype.Repository;

import com.eascs.web.sso.User;
import com.eascs.workflow.common.dao.BaseDao;

@Repository
public class EaSsoDao extends BaseDao {
	public <T extends User> T getUserByAccount(String loginName, Class<T> type) {
		String sql = "select e.employee_no as no,e.employee_code as code,e.employee_namecn as cname,e.email as email,e.province_code as org, "
				+ " e.mobile as mobile,e.employee_account as account, o.nodenamecn as nodenamecn,e.is_dimission as status from o2o_employee e,hr_organ o "
				+ " where e.node_id = o.nodeno and e.employee_account = ? ";
		return this.workflowJdbcSession.findEntity(sql, type, loginName);
	}

	public <T extends User> T getUserByNo(String userNo, Class<T> type) {
		String sql = "select e.employee_no as no,e.employee_code as code,e.employee_namecn as cname,e.email as email, e.province_code as org, "
				+ " e.mobile as mobile,e.employee_account as account, o.nodenamecn as nodenamecn,e.is_dimission as status from o2o_employee e,hr_organ o "
				+ " where e.node_id = o.nodeno and e.employee_no = ? ";
		return this.workflowJdbcSession.findEntity(sql, type, userNo);
	}
}
